using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApp2
{
    public partial class Form1 : Form
    {
        string s1, s2;
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            s1=textBox1.Text;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string[] lines1=File.ReadAllLines(s1, Encoding.UTF8);
            string[] lines2=File.ReadAllLines(s2, Encoding.UTF8);
            File.WriteAllLines("data.txt", lines1, Encoding.UTF8);
            File.AppendAllLines("data.txt", lines2 , Encoding.UTF8);
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            s2=textBox2.Text;
        }
    }
}